package myky.com.doctorapp.model

import io.reactivex.Observable
import myky.com.doctorapp.api.ApiManager
import myky.com.doctorapp.base.BaseEntity
import myky.com.doctorapp.contract.FindDoctorSeachContract
import myky.com.doctorapp.utils.RequestBodyBuilder

class FindDoctorSeachModel : FindDoctorSeachContract.Model {
    override fun findReleseContent(content: String, type: Int): Observable<BaseEntity<List<String>>> {
        val requestBodyBuilder = RequestBodyBuilder.Builder()
        requestBodyBuilder.params("input", content)
        requestBodyBuilder.params("searchType", type.toString())
        requestBodyBuilder.params("version", "v1.0")
        val requestBody = requestBodyBuilder.build()
        return ApiManager.getApistore().findReleseContent(requestBody)
    }
}
